import request from '@/utils/request';
import { getPageSize } from '@/utils/common';

export async function selectList(params) {
  params.pageSize = params.pageSize || getPageSize();
  return request(`/server/api/tmw-user/selectTmwUserList`, {
    method: 'POST',
    body: params,
    type: 'enableEnum',
  });
}

export async function selectDetails(params) {
  return request(`/server/api/tmw-user/viewTmwUserDetails`, {
    method: 'POST',
    body: params,
  });
}

export async function TMWLoginAdd(params) {
  return request(`/server/api/tmw-user/insertTmwUser`, {
    method: 'POST',
    body: params,
  });
}

export async function TMWLoginEdit(params) {
  return request(`/server/api/tmw-user/updateTmwUser`, {
    method: 'POST',
    body: params,
  });
}

export async function disabledTMWLogin(params) {
  return request(
    `/server/api/customer/disabledCustomer`,
    {
      method: 'POST',
      body: params,
    },
    true
  );
}
export async function enableTMWLogin(params) {
  return request(
    `/server/api/customer/enableCustomer`,
    {
      method: 'POST',
      body: params,
    },
    true
  );
}

export async function deleteTask(params) {
  return request(
    `/server/api/tmw-user/deleteTmwUser`,
    {
      method: 'POST',
      body: params,
    },
    true
  );
}
